/*******************************************************************
 *  Copyright(c) 2018-2018 A single spark
 *  All rights reserved.
 *
 *  文件名称:yuvaboutdialog.cpp
 *  简要描述:关于界面--显示版本相关信息
 *
 *  修改日期:  2018.03.06
 *  作者:      LD
 *  邮箱:
 *  说明:
 *
 *  修改日期:
 *  作者:
 *  邮箱:
 *  说明:
 ******************************************************************/

#include "yuvaboutdialog.h"

#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QApplication>
#include <QDateTime>

YUVAboutDialog::YUVAboutDialog(QWidget *parent)
    : YUVDialog(parent)
{
    setWindowTitle(tr("About A single spark"));
    setWindowFlags(windowFlags()&(~Qt::WindowContextHelpButtonHint));
    initUI();
}

YUVAboutDialog::~YUVAboutDialog()
{

}

void YUVAboutDialog::initUI()
{
    m_pVLayoutMain = new QVBoxLayout(this);
    m_pVLayoutLeft = new QVBoxLayout;
    m_pHLayoutBottom = new QHBoxLayout;

    m_pLbTitle = new QLabel(this);
    m_pLbTitle->setObjectName("aboutTitle");
    m_pLbIcon = new QLabel(this);
    m_pLbIcon->setObjectName("aboutIcon");
    m_pLbContent = new QLabel(this);
    m_pLbContent->setObjectName("aboutText");

    QString strContent = QString(tr("<p>Based on Qt 5.9.4</p>"
                        "<p>Built on %1</p>"
                        "<p>Copyright 2018-2018 The A single spark group. All rights reserved.</p>"
                        )).arg(QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm"));
    m_pLbContent->setText(strContent);

    m_pVLayoutLeft->addWidget(m_pLbIcon);

    m_pHLayoutBottom->addLayout(m_pVLayoutLeft);
    m_pHLayoutBottom->addWidget(m_pLbContent);

    m_pLbTitle->setText(tr("<h2><b>A single spark</b></h2>"));
//    m_pLbTitle->setAlignment(Qt::AlignCenter);
    m_pVLayoutMain->addWidget(m_pLbTitle);
    m_pVLayoutMain->addLayout(m_pHLayoutBottom);
    setLayout(m_pVLayoutMain);
}
